package top.yongyan0624.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;


/**
 * <p>
 * 
 * </p>
 *
 * @author yongyan
 * @since 2021-08-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SysUser extends BaseEntity {

    private static final long serialVersionUID = 1L;

    private String username;

    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;

    /**
     * 账号类别，0：用户账号。1：公司账号
     */
    private Integer type;

    /**
     * 性别，若账号为公司账号，本字段为空
     */
    private String sex;

    /**
     * 年龄，若账号为公司账号，本字段为-1
     */
    private Integer age;

    /**
     * 公司法人，若账号为用户账号，本字段为空
     */
    private String legalPerson;

    private String avatar;

    private String phone;

    private String address;

    @TableField(exist = false)
    private List<SysRole> roles = new ArrayList<>();

}
